<div class="content">
<h2 style="margin-top: 0;">Zutaten für Cocktailrezepte</h2>
<table class="table">
	<thead>
		<tr>
			<th>Zutat</th>
			<th>Kalorien</th>
			<th>Preis</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach ($this->ingredients as $ingredient){ /* @var $ingredient Website_Model_Ingredient */ ?>
		<tr>
			<td><a
				href="<?php print $this->url(array('controller'=>'ingredient','action'=>'get','module'=>'website','id'=>$ingredient->getUniqueName())); ?>?format=mobile">
				<?php print $ingredient->name; ?></a> (<?php if($ingredient->getAverageAlcoholLevel()) { print $ingredient->getAverageAlcoholLevel().'&nbsp;%'; } else { print '0&nbsp;%'; } ?>)<?php 
			$numberOfRecipes = $ingredient->getNumberOfRecipes();
			if($numberOfRecipes) { ?>, <a href="<?php print $this->url(array(
				'controller'=>'ingredient','action'=>'get','module'=>'website',
				'id'=>$ingredient->getUniqueName())); ?>?format=mobile#recipes-list">
				<?php print $numberOfRecipes; ?>&nbsp;Rezepte</a><?php
			} 
			$products = Website_Model_Product::numberOfProductsByIngredientId($ingredient->id);
			if($products>0) { ?>, <a href="<?php print $this->url(array(
				'controller'=>'ingredient','action'=>'get','module'=>'website',
				'id'=>$ingredient->getUniqueName())); ?>?format=mobile#products-list"><?php print $products; ?>&nbsp;Produkte</a><?php 
			} ?></td>
			<td><?php if($ingredient->getAverageCaloriesKcal()) { print round($ingredient->getAverageCaloriesKcal()/10); ?>&nbsp;kcal<?php } else { print 'k.A.'; } ?></td>
			<td><?php 
			if($ingredient->getAveragePricePerLitre() || $ingredient->getAveragePricePerKilogram()) {
				if($ingredient->getAveragePricePerLitre()) {
					print number_format($ingredient->getAveragePricePerLitre(),2,',','.').'&nbsp;€&nbsp;/&nbsp;l ';
				}
				if($ingredient->getAveragePricePerLitre() && $ingredient->getAveragePricePerKilogram()) {
					print ' bzw. ';
				}
				if($ingredient->getAveragePricePerKilogram()) {
					print number_format($ingredient->getAveragePricePerKilogram(),2,',','.').'&nbsp;€&nbsp;/&nbsp;kg';
				}
			} ?></td>
		</tr>
		<?php } ?>
	</tbody>
</table>
</div>